package com.automannn.atm_back.modules.system.service;

import com.automannn.atm_back.common.exception.AtmBackException;
import com.automannn.atm_back.modules.system.entity.SysCategory;
import com.automannn.atm_back.modules.system.model.TreeSelectModel;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;
import java.util.Map;

/**
 * 分类字典
 * @author chenkh
 * @time 2020/6/26 21:49
 */
public interface ISysCategoryService extends IService<SysCategory> {
    /**根节点父ID的值*/
       String ROOT_PID_VALUE = "0";

    void addSysCategory(SysCategory sysCategory);

    void updateSysCategory(SysCategory sysCategory);

    /**
     * 根据父级编码加载分类字典的数据
     * @param pcode
     * @return
     */
     List<TreeSelectModel> queryListByCode(String pcode) throws AtmBackException;

    /**
     * 根据pid查询子节点集合
     * @param pid
     * @return
     */
     List<TreeSelectModel> queryListByPid(String pid);

    /**
     * 根据pid查询子节点集合,支持查询条件
     * @param pid
     * @param condition
     * @return
     */
     List<TreeSelectModel> queryListByPid(String pid, Map<String,String> condition);

    /**
     * 根据code查询id
     * @param code
     * @return
     */
     String queryIdByCode(String code);
}
